<?php

class RubricModule extends fvModule {

    function __construct () {
        $moduleName = strtolower(substr(__CLASS__, 0, -6));

        parent::__construct(fvSite::$fvConfig->get("modules.{$moduleName}.smarty.template"), 
                            fvSite::$fvConfig->get("modules.{$moduleName}.smarty.compile"), 
                            fvSite::$Layoult);
    }

    function showIndex() {
        //var_dump(fvSite::$fvConfig->get('modules.Rubric'));
        
        $pager = new fvPager(RubricManager::getInstance());
        $this->__assign('Rubrics', $pager->paginate());
        return $this->__display('rubric_list.tpl');    
    }

    function showEdit() {
        $request = fvRequest::getInstance();
        if (!$Rubric = RubricManager::getInstance()->getByPk($request->getRequestParameter('id'))) {
            $Rubric = new Rubric();
        }
        
        $this->__assign('Rubric' , $Rubric);
        return $this->__display('rubric_edit.tpl');
        
    }
}

?>
